const promise = new Promise(function executor(resolve,reject){
     //resolve('成功');
     reject('失败')
});
promise.finally(()=>{
    console.log('finally');
});
/* promise.catch(function onRejected(error){
    console.log(error);
}) */
/**
 [UnhandledPromiseRejection: 
    This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "失败".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

 */

/* try{
    console.log(1);
    throw new Error('发生了错误')
}catch(error){
  console.log('catch error');
}finally{
    console.log('finally');
} */